﻿using System;
using System.Collections.Generic;
using SFML.Graphics;
using Theta.Input;
using Theta.Managers;
using Theta.Physics;

namespace Theta
{
    public abstract class ThetaGame : IDisposable
    {
        public EntityList Entities { get; set; }
        public InputManager Input { get; set; }
        public PhysicsManager Physics { get; set; }
        public ContentManager Content { get; set; }

        protected ThetaGame()
        {
        }


        public virtual void Initialize()
        {
            Input = new InputManager();
            Physics = new PhysicsManager();
            Content = new ContentManager();
            Entities = new EntityList();
        }

        public virtual void Update(TimeSpan elapsedTime)
        {
            Input.Update();
            Physics.Update(elapsedTime);
            Entities.Update(elapsedTime);
        }

        public virtual void Draw(RenderWindow renderWindow)
        {
            Entities.Draw(renderWindow);
        }

        public virtual void Dispose()
        {
            Entities.Dispose();
        }
    }
}
